package cn.tude.xctf.boot21.mapper;

import cn.tude.xctf.boot21.entity.Login;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface LoginMapper {
    //如果查询到的是一条数据可以通过一个自定义的东西接收，如果是多个数据通过一个
    //自定义对象就会报错
    @Select("select * from user where username=#{username}")
    Login selectByUsername(String username);
//    @Select("select * from user where username=#{username} and password=#{password}")
//    Login selectByUsername(String username);

    @Insert("insert into  user values (null,#{username},#{password},#{nick})")
    void insert(Login login);
}